<template>
  <div class="box">
    <div class="detBox">
            <el-row>
                <el-col :span="24">
                    <div class="grid-content bg-purple">
                        <div class="btitle">{{$t('coracc')}}</div>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <div class="bhead">{{$t('bankacc')}}</div>
                    </div>
                </el-col>
                <el-col :span="20">
                    <div class="grid-content bg-purple-light">
                        <div class="bbody">{{result.bankCardNo}}</div>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <div class="bhking">{{$t('opnbank')}}</div>
                    </div>
                </el-col>
                <el-col :span="8">
                    <div class="grid-content bg-purple-light">
                        <div class="bbking">
                            <div>{{result.branchBankName}}</div>
                        </div>
                    </div>
                </el-col>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <div class="bhking">{{$t('bankcdtp')}}</div>
                    </div>
                </el-col>
                <el-col :span="8">
                    <div class="grid-content bg-purple-light">
                        <div class="bbking">
                            <div>{{result.bankCardType}}</div>
                        </div>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <div class="bhead">{{$t('sta')}}</div>
                    </div>
                </el-col>
                <el-col :span="20">
                    <div class="grid-content bg-purple-light">
                        <div class="bbody">{{result.status}}</div>
                    </div>
                </el-col>
            </el-row>
        </div>
  </div>
</template>

<script>
import {
  getsettlelist
} from '@/libs/reqlist.js'
export default {
  data() {
    return {
      // 接收返回的结算信息结果
      result: {},
      // 账户类型的值
      accountType: '',
      // 银行卡类型
      bankCardType: '',
      // 查询入参
      select: {
        merId: ''
      }
    }
  },
  methods: {
    // 查询结算信息
    getSettleInfo() {
      getsettlelist(JSON.stringify({ merId: this.select.merId }))
        .then(res => {
          if (res.data.code === '000000') {
            this.result = res.data.data
            // 账户类型、银行卡类型
            if (this.result.bankCardType === 'PUB') {
                this.accountType = this.$t('pubacc')
                this.bankCardType = this.$t('pubacc')
            }
            if (this.result.bankCardType === 'DEBIT') {
                this.accountType = '个人账户'
                this.bankCardType = '借记卡'
            }
            if (this.result.bankCardType === 'CREDIT') {
                this.accountType = '个人账户'
                this.bankCardType = '贷记卡'
            }
            // 状态
            if (this.result.status === 'VALID') {
                this.result.status = this.$t('vlid')
            }
            if (this.result.status === 'INVALID') {
                this.result.status = this.$t('invlid')
            }
          }
        })
    }
  },
  mounted() {
    // 全局商户id
    this.select.merId = window.sessionStorage.getItem('merId')
    this.getSettleInfo()
  }
}
</script>

<style lang="less" scoped>
@import "./settleInfo.less";
</style>
